import axios from 'axios'
export function Person(config) {
    // 1.创建axios的实例
    const Person = axios.create({
      baseURL: 'https://qc3atp.api.cloudendpoint.cn',
      timeout: 5000,
      // withCredentials: true,
    })
  
    // 2.axios的拦截器
    Person.interceptors.request.use(config => {
      if(window.localStorage.getItem('token')) {
          config.headers.authorization = window.localStorage.getItem('token')
      } 
      return config
    }, err => {
      console.log(err);
    })
  
    // 3.发送真正的网络请求
    return Person(config)
  }
  